
public class Customer {
	String[] names = new String[30];

	public void addName(String name){
		for (int i = 0; i < names.length; i++) {
			if(names[i]==null){
				names[i] = name;
				break;
			}
		}
	}

	public void showName(){
		for (int i = 0; i < names.length; i++) {
			if(names[i]!=null){
				System.out.print(names[i]+" ");
			}
		}
		System.out.println();
	} 
	
	public boolean modifyName(String oldName,String newName){
		int index = searchName(oldName);
		if(index!=-1){
			names[index] = newName;
			return true;
		}
		return false;
	}
	
	public int searchName(String name){
		for (int i = 0; i < names.length; i++) {
			if(names[i]!=null&&names[i].equals(name)){
				return i;
			}
		}
		
		return -1;
	}

}
